
<%template _header%>
<script type="text/javascript" src="/support/alpha/Js/mootools.js"></script>
<%namespace YouHP.Model%>
<%namespace YouHP.Model.Group%>
<%namespace YouHP.Utility%>

<script type="text/javascript">
		var curtab = "location";
		function swapTab(tab)
		{

			 var ctrl = _$("ui-" + curtab);
			 ctrl.style.display = 'none';
			 ctrl = _$("ui-" + tab);
			 ctrl.style.display = 'block';
			 curtab = tab;
			
		}
		
		
        function checkform()
        { 
          var f =_$("postform");
           f.submit();
        }
                  
                
	   
</script>


    
    

<div class="layout-cols2">
<div class="col1">

   <%csharp%>TempUrl = ModuleCtrl.Header4("searchgroups","搜索圈子",false,false); <%/csharp%>
{TempUrl}
  <div class="content">
      <div id="search-links" class="searchbox">
	                
			        <label>选择搜索条件：</label>
                    <a href="#" id="lnk-location" name="location" onclick="swapTab('location');">圈子地区|</a>
                    <a href="#"id="lnk-age" name="group" onclick="swapTab('group');">圈子名|</a> 
                    <a href="#" id="lnk-age" name="disease" onclick="swapTab('disease');">圈子关联疾病</a> 
         </div>

    <div id="search-ui">
        <%csharp%>TempUrl="/Group/GroupListBySearch.aspx";<%/csharp%>
        <form  id="postform" method="get" action="{this.GetUrl(TempUrl)}" >
                 <table cellpadding="0" cellspacing="0" border="0"> 
                 <tr><td>
                    <div id="ui-location" style="display: block; float:left;">
                     圈子地区: 
                    省份
                    <select name="provinceId" id="province"  onchange="if(this.value !='') setCity(this.options[this.selectedIndex].value)">
                 
                    <option value="">-不限-</option>  

                    <%csharp%>
                    foreach(DistrictInfo Info in ProvinceList)
                    {
                    <%/csharp%>
                    <option value="{Info.Id}">{Info.Name}</option>     
                    <%csharp%>
                    }
                    <%/csharp%>
                    </select>
                    城市
                    <select name="cityId" id ="city">
                    <option value ="">-不限-</option>
                    </select>
                    </div>
                    <div id="ui-group" style="display: none;float:left;">
                       圈子名：
                        <input type="text" id="groupname" name="groupName" length="20">
                    </div>
                    <div id="ui-disease" style="display: none;float:left;">
                        圈子关联疾病:
                        <select id="disease" name="diseaseId">
                            <option value="" selected>不限</option>
                            <%csharp%>
                            foreach( DiseaseInfo Info in DiseaseLst) {
                            <%/csharp%>
                            <option value="{Info.Id}">{Info.Name}</option>
                            <%csharp%>
                            }
                            <%/csharp%>
                        </select>
                    </div>
                  </td><td>
                &nbsp;&nbsp; <input id="post" type="button" value="搜索" onclick="checkform()" class="button1" />
                <%csharp%>TempUrl = "/User/Group/Create.aspx"; <%/csharp%>   
                    </td><td align="right" width="200px">
              <a href="{this.GetUrl(TempUrl)}" class="yellowbutton">创建圈子</a></td>
              </tr>
            </table>  
        </form>
        
    </div> 
    
    </div>

<%csharp%>TempUrl = ModuleCtrl.Footer("searchgroups"); <%/csharp%>
{TempUrl} 

<script type="text/javascript" runat="server">

window.onload = function()
{
  var aurl = "/Pages/alpha/Group/AllGroupListAjax.aspx"+"?page=1";
  var myAjax=new Ajax(aurl,
  {
     method:'get',
     onComplete:function()
     {
      var html=this.response.text;
      _$("allgroups").innerHTML=html;
      }
   }
   );
   myAjax.request();

}  

function getAllGroupList(pageindex)
{
    
  var aurl = "/Pages/alpha/Group/AllGroupListAjax.aspx"+"?page="+pageindex;
  var myAjax=new Ajax(aurl,
  {
     method:'get',
     onComplete:function()
     {
      var html=this.response.text;
      _$("allgroups").innerHTML=html;
      }
   }
   );
   myAjax.request();
  
  
}  

</script>
<div class="box" style="clear:both">
<div class="content">
<div class="grouplistbox">
<%if UserData.Id>0%>
    <%if GroupListCommend.Count!=0 && PrData.DiseaseId>0%>
   <p>系统推荐圈子（根据您所患疾病推荐）</p>
    <div class="grouplist" id="commentgroups">
    <%csharp%>
    int i = 0;
    foreach(GroupInfo item in GroupListCommend) { 

    <%/csharp%> 
    <%csharp%>if(i > 0 && i % 3 == 0) { <%/csharp%>        
    <div class="line"></div>
    <%csharp%> } <%/csharp%>
    <div class="groupbox">
    <%csharp%>TempUrl = "/Group/Group.aspx?gid=" + item.Id;<%/csharp%>
    <a href="{this.GetUrl(TempUrl)}" target="_blank">
        <img class="pic" src="{item.Logo}" />
    </a>
    <dl>
        <dd><strong>
        <%csharp%>TempUrl = "/Group/Group.aspx?gid=" + item.Id;<%/csharp%>
        <a href="{this.GetUrl(TempUrl)}" target="_blank">
            <%csharp%>if(item.GroupName.Length<=8){<%/csharp%>
            {item.GroupName}
            <%csharp%>}else{ string sb=item.GroupName.Substring(0,8)+"...";<%/csharp%>
            {sb}
            <%csharp%>}<%/csharp%>
        
        </a>
        </strong></dd>
        <dt>共{item.UserNum}人</dt>
<!--        <dd>帖子数：{item.PostNum} &nbsp;&nbsp; 点击量：{item.Hits}</dd>-->
            
        <%csharp%>if(item.ProvinceName==""&&item.CityName==""){<%/csharp%>
        <dt>地区：未知</dt>
         <%csharp%>}else{<%/csharp%>
        <dt>
            地区：{item.ProvinceName}&nbsp;{item.CityName}
        </dt>
          <%csharp%>}<%/csharp%>

    </dl>
    </div>
    <%csharp%> i++; } <%/csharp%>
    </div>
    <%/if%> 
    
    <p style="clear:both">我的圈子</p>
    <div class="grouplist" id="mygroups">
    <div style="padding:20px 50px;">
		     <%csharp%> TempUrl = "/images/indicator_medium.gif";<%/csharp%>
		        <img src="{this.GetResource(TempUrl)}" /><b>正在加载圈子列表……</b>
             
           </div>
    </div>
    
    <script type="text/javascript" runat="server">

        window.onload = function()
        {
              var aurl = "/Pages/alpha/Group/MyGroupListAjax.aspx"+"?page=1";
              var myAjax=new Ajax(aurl,
            {
             method:'get',
             onComplete:function()
             {
              var html=this.response.text;
              _$("mygroups").innerHTML=html;
              }
            }
            );
               myAjax.request();
               
            aurl = "/Pages/alpha/Group/AllGroupListAjax.aspx"+"?page=1";
            myAjax=new Ajax(aurl,
            {
            method:'get',
            onComplete:function()
            {
            var html=this.response.text;
            _$("allgroups").innerHTML=html;
            }
            }
            );
            myAjax.request();
        }
        function getMyGroupList(pageindex)
        {
      
        var aurl = "/Pages/alpha/Group/MyGroupListAjax.aspx"+"?page="+pageindex;
        var myAjax2=new Ajax(aurl,
        {
         method:'get',
         onComplete:function()
         {
          var html=this.response.text;

            _$("mygroups").innerHTML=html;
          }
        }
        );
        myAjax2.request();
        }  
        
    </script>   
<%/if%>    

<p>所有圈子</p>
<div class="grouplist" id="allgroups" style="display:block;">
<div style="padding:20px 50px;">
		     <%csharp%> TempUrl = "/images/indicator_medium.gif";<%/csharp%>
		        <img src="{this.GetResource(TempUrl)}" /><b>正在加载圈子列表……</b>
             
           </div>

 </div>  
 </div>
 </div>  
</div> 


</div>

 
<div class ="col2">
  
<%template _GroupLattest%> 
<%template _GroupHottest%> 
</div>
</div> 
<%template _footer%>